package com.huluobo.base.net

import com.huluobo.base.bean.CategoryBeanResult
import com.huluobo.base.bean.CommentBeanResult
import com.huluobo.base.bean.GoodsDetailBeanResult
import com.huluobo.base.bean.HomeBannerBeanResult
import com.huluobo.base.bean.HomeGoodsBeanResult
import com.huluobo.base.bean.HomeNavBeanResult
import com.huluobo.base.bean.UserBeanResult
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 *  Created by LC on 2024/8/7.
 */
interface ApiService {
    @POST(Const.URL_LOGIN)
    fun login(@Body body: RequestBody): Observable<UserBeanResult>

    @POST(Const.URL_REGISTER)
    fun register(@Body body: RequestBody): Observable<UserBeanResult>

    @GET(Const.URL_GET_HOME_GOODS_LIST)
    fun getHomeGoodsList(
        @Query(Const.PARAM_CATEGORY_ID) categoryId: Int,
        @Query(Const.PARAM_CURRENT_PAGE) currentPage: Int,
        @Query(Const.PARAM_PAGE_SIZE) pageSize: Int
    ): Observable<HomeGoodsBeanResult>

    @GET(Const.URL_HOME_BANNER)
    fun getHomeBanner(): Observable<HomeBannerBeanResult>

    @GET(Const.URL_HOME_NAV)
    fun getHomeNav(): Observable<HomeNavBeanResult>

    @GET(Const.URL_GOODS_DETAIL)
    fun getGoodsDetail(@Query(Const.PARAM_GOODS_ID) goodsId: Int): Observable<GoodsDetailBeanResult>

    @GET(Const.URL_COMMENT)
    fun getComment(@Query(Const.PARAM_COMMENT_ID) commentId: Int = 104): Observable<CommentBeanResult>

    @GET(Const.URL_CATEGORY_LIST)
    fun getCategoryList(): Observable<CategoryBeanResult>
}